<template>
  <!-- 小弹框 width:500,height:0.3,top:15%  -->
  <!-- 中弹框 width:800,height:0.5,top:10% -->
  <!-- 大弹框 width:1060,height:0.76,top:5% -->
  <!-- 超大弹框 width:1460,height:0.76,top:5% -->

  <div class="Control-1 mechanism_dialogS closure" id="comcn small">
    <el-dialog
      width="1060px"
      :title="title"
      v-loading="loading"
      element-loading-text="拼命加载中"
      element-loading-background="rgba(0, 0, 0, 0.2)"
      element-loading-spinner="el-icon-loading"
      v-dialogDrag
      :visible.sync="visible"
      @close="closeDialog"
      :append-to-body="true"
      top="5%"
    >
      <div
        class="dialogBody common commonClassDialog moduleDialog"
        id="longLable"
        :style="{ height: dialogHeight }"
        style="width: 100%"
      >
        <div style="overflow-y: auto; margin-bottom: 20px">
          <div
            class="tab"
            v-if="displaySwitching != 0 && displaySwitching != 1"
          >
            <div
              v-for="(data, index) in typeData"
              :key="data.value"
              @click="changeType($event, index)"
            >
              <div
                class="btn"
                :style="{
                  color:
                    data.show === true ? 'rgba(0, 117, 255, 1)' : '#343639',
                  background: data.show === true ? '#E0EFFF' : '#fff',
                }"
              >
                {{ data.text }}
              </div>
            </div>
          </div>

          <div
            class="publicForm"
            style="height: 500px"
            v-if="typeData[0].show && displaySwitching != 1"
          >
            <!--  @selectBlur="selectBlur" -->
            <publicForm
              ref="publicForm"
              lableWidth="100px"
              :formObj="formObj"
              :formData="formData"
              :selected="selected"
              @changeRadio="changeRadio"
              @selectChange="selectChange"
              @inputFocus="inputFocus"
              @handleNodeClick="handleNode"
              @clickDialog="clickDialog"
              fileType="0"
              :timestamp="formData.fPhotofile"
              :timestamp1="formData.fSourcefile"
              :fileList="fileList"
              :fileList1="fSourcefileList"
              @delteFile="delteFile($event, 0)"
            >
            </publicForm>

            <div class="newlyAdded_btn" v-if="btnShow && displaySwitching == 0">
              <el-button
                :disabled="isLock"
                type="primary"
                @click="yj_saveForm(0)"
              >
                保存
              </el-button>
              <el-button type="warning" @click="visible = false">
                关闭
              </el-button>
            </div>
          </div>

          <div
            class="publicForm"
            style="height: 500px"
            v-if="typeData[1].show && displaySwitching != 0"
          >
            <publicForm1
              ref="publicForm1"
              lableWidth="100px"
              :formObj="formObjAccept"
              :formData="formDataAccept"
              @selectChange="selectChange"
              @inputFocus="inputFocus"
              @clickDialog="clickDialog"
            >
            </publicForm1>

            <div class="newlyAdded_btn" v-if="btnShow && displaySwitching == 2">
              <el-button
                :disabled="isLock"
                type="primary"
                @click="yj_saveForm(1)"
              >
                保存
              </el-button>
              <el-button type="warning" @click="visible = false">
                关闭
              </el-button>
            </div>
          </div>
        </div>
      </div>
    </el-dialog>

    <!-- 材料进场编号 -->
    <el-dialog
      width="1060px"
      title="材料进场编号选择"
      v-dialogDrag
      :visible.sync="dialogEditVisible_cl"
      :append-to-body="true"
      top="5%"
    >
      <div
        class="dialogBody common commonClassDialog moduleDialog"
        id="longLable"
        :style="{ height: dialogHeight }"
        style="width: 100%"
      >
        <div
          style="
            width: 100%;
            margin-bottom: 20px;
            height: calc(100% - 42px);
            display: flex;
              flex-direction: column;
          "
        >
          <div>
            <publicForm2
              ref="publicForm9"
              @yj_searchForm="yj_searchForm_cl"
              lableWidth="110px"
              :formObj="searchObj"
              :formData="getList_cl"
            >
            </publicForm2>
          </div>
          <div style="display: flex; height: 92%; overflow: auto !important">
            <div class="leftTree" v-if="treelength">
              <tree
                style="height: 100%"
                :treeData="treeData"
                :checkData="checkData"
                nodeKey="fCompanyid"
                @getTreeInfo="handleNodeClickTree"
                :defaultProps="defaultProps"
              >
              </tree>
            </div>

            <div class="rightCon">
              <tableData
                :page="getList_cl.page"
                :pageSize="getList_cl.pageSize"
                :height="navigatepageNums_cl > 1 ? 'calc(100% - 50px)' : '100%'"
                :config="table_config_cl"
                :dataList="tableData_cl"
                :loading="loading"
                :info="queryCriteriaData_cl"
                :total="queryCriteriaData_cl.total"
                :pageNum.sync="getList_cl.page"
                :limit.sync="getList_cl.pageSize"
                @click-change="rowChange_cl"
                @ClickOnLine="yj_viewForm_cl"
                @pagination="yj_searchForm_cl(getList_cl)"
              />
            </div>
          </div>
        </div>
        <div class="newlyAdded_btn" v-if="btnShow">
          <el-button
            :disabled="isLock"
            type="primary"
            @click="yj_saveForm_cl()"
          >
            保存
          </el-button>
          <el-button type="warning" @click="dialogEditVisible_cl = false"
            >关闭</el-button
          >
        </div>
      </div>
    </el-dialog>
    <!-- 材料进场编号 -->

    <!-- WBS -->
    <custom-dialog
      @refreshList="refreshList"
      v-if="WBSShow"
      :dialogVisible="WBSShow"
      @close1="WBSDialog"
      @getWBS="getWBS"
    >
    </custom-dialog>
    <!-- WBS -->

    <!-- 根据组织机构树选人 -->
    <el-dialog
      width="1060px"
      title="根据组织机构树选人"
      v-dialogDrag
      :visible.sync="dialogEditVisibleTree"
      :append-to-body="true"
      top="5%"
    >
      <div
        class="dialogBody common commonClassDialog moduleDialog"
        id="longLable"
        :style="{ height: dialogHeight }"
        style="width: 100%"
      >
        <div style="margin-bottom: 45px; height: 100%">
          <div
            class="publicForm addMemberCheckBox"
            style="height: calc(100% - 40px); overflow-y: auto; width: 100%"
          >
            <div class="addMemberCheckTree">
              <div class="companyBox">
                <el-tree
                  :data="companyInfo"
                  :props="defaultProps"
                  @node-click="selectCompany"
                  :highlight-current="highlightBd"
                ></el-tree>
              </div>
              <div class="departmentBox">
                <div
                  class="departmentTitle"
                  v-for="(item, index) in departmentList"
                  :key="index"
                  @click="seletDepartment(item, index)"
                >
                  <a
                    href="javascript:;"
                    :class="num === item.fDepartmentId ? 'activetext' : ''"
                    :title="item.fShortName"
                  >
                    {{ item.fShortName }}</a
                  >
                </div>
              </div>
            </div>

            <div class="addMemberCheckLeft">
              <el-radio-group
                v-model="checkboxGroup1"
                @change="selectRealname($event, personList)"
              >
                <el-radio-button
                  v-for="item in personList"
                  :label="item.fUserid"
                  :key="item.fUserid"
                  :value="item.fRealname"
                >
                  <div class="addMemberCheck">
                    <div class="MemberIcon">
                      <img :src="item.fGender == 0 ? girls : boys" alt="" />
                    </div>
                    <div class="MemberDetailInfos">
                      <div class="name">{{ item.fRealname }}</div>
                      <div class="hostName">{{ item.fDepartmentName }}</div>
                      <div class="hostName">{{ item.fAccount }}</div>
                    </div>
                  </div>
                </el-radio-button>
              </el-radio-group>
            </div>
          </div>
        </div>
      </div>
      <div class="newlyAdded_btn" v-if="btnShow">
        <el-button type="primary" @click="submitMember()">保存</el-button>
        <el-button type="warning" @click="dialogEditVisibleTree = false"
          >关闭</el-button
        >
      </div>
    </el-dialog>
    <!-- 根据组织机构树选人 -->
  </div>
</template>

<script src="./index.js"></script>
<style lang="less" scoped>
@import "./index.less";
</style>
